2020-2021 Sunseeker Telemetry and Lighting System
eusci_a_spi_ex1_slave.c File Reference
#include "driverlib.h"

Go to the source code of this file.

Functions

void main (void)
 
void USCI_A0_ISR (void)
 

Variables

uint8_t transmitData = 0x01
 
uint8_t receiveData = 0x00
 

Function Documentation

◆ main()

void main ( void  )

Definition at line 76 of file eusci_a_spi_ex1_slave.c.

References param.

◆ USCI_A0_ISR()

void USCI_A0_ISR ( void  )

Definition at line 156 of file eusci_a_spi_ex1_slave.c.

References receiveData, and transmitData.

Variable Documentation

◆ receiveData

uint8_t receiveData = 0x00

Definition at line 74 of file eusci_a_spi_ex1_slave.c.

◆ transmitData

uint8_t transmitData = 0x01

SPI slave talks to SPI master using 3-wire mode. Data is received from master and data from slave is then transmitted back to master. USCI RX ISR is used to handle communication, CPU normally in LPM4. Prior to initial data exchange, master pulses slaves RST for complete reset.

Use with eusci_spi_ex1_master code example. If the slave is in debug mode, the reset signal from the master will conflict with slave's JTAG; to work around, use IAR's "Release JTAG on Go" on slave device. If breakpoints are set in slave RX ISR, master must stopped also to avoid overrunning slave RXBUF.

Tesed on MSP430FR5969 and MSP430FR5739

/|\ | | | | | Master—+->|RST | | | | P2.0|-> Data Out (UCA0SIMO) | | | P2.1|<- Data In (UCA0SOMI) | | | P1.5|<- Serial Clock Out (UCA0CLK)

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • SPI peripheral
  • GPIO Port peripheral (for SPI pins)
  • UCA0SIMO
  • UCA0SOMI
  • UCA0CLK

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • USCI_A0_VECTOR

Definition at line 74 of file eusci_a_spi_ex1_slave.c.